//选项卡
var swiper = new Swiper('.swiper-container-main1-left', {
      spaceBetween: 30,
      effect: 'fade',
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      loop:true,
      autoplay:true,
    });
       var spanTxt = document.querySelectorAll('.swiper-pagination-bullet')
        spanTxt[0].innerHTML ='网络文学优秀作品联展'
        spanTxt[1].innerHTML ='萌妻变甜啦'
        spanTxt[2].innerHTML ='我和总统结婚了'
        spanTxt[3].innerHTML ='他的陆太太很甜'
        spanTxt[4].innerHTML ='许你晴空万里'
var kuandu = document.body.offsetWidth;
    if (kuandu<860) {
            spanTxt[0].innerHTML =''
            spanTxt[1].innerHTML =''
            spanTxt[2].innerHTML =''
            spanTxt[3].innerHTML =''
            spanTxt[4].innerHTML =''
    }


//自动轮播
var mySwiper = new Swiper('.swiper-container-main-3',{
    slidesPerView : 5,
    spaceBetween : 0,
    //spaceBetween : '10%',按container的百分比
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    },
    loop: true,
    autoplay:true,
})
        
        
        
        
        
        
        
        
//倒计时

window.onload=clock;
function clock(){
var today=new Date(),//当前时间
    h=today.getHours(),
    m=today.getMinutes(),
    s=today.getSeconds();
  var stopTime=new Date("9 1 2019 00:00:00"),//结束时间
    stopH=stopTime.getHours(),
    stopM=stopTime.getMinutes(),
    stopS=stopTime.getSeconds();
  var shenyu=stopTime.getTime()-today.getTime(),//倒计时毫秒数
    shengyuD=parseInt(shenyu/(60*60*24*1000)),//转换为天
    D=parseInt(shenyu)-parseInt(shengyuD*60*60*24*1000),//除去天的毫秒数
    shengyuH=parseInt(D/(60*60*1000)),//除去天的毫秒数转换成小时
    H=D-shengyuH*60*60*1000,//除去天、小时的毫秒数
    shengyuM=parseInt(H/(60*1000)),//除去天的毫秒数转换成分钟
    M=H-shengyuM*60*1000;//除去天、小时、分的毫秒数
    S=parseInt((shenyu-shengyuD*60*60*24*1000-shengyuH*60*60*1000-shengyuM*60*1000)/1000)//除去天、小时、分的毫秒数转化为秒

    // 这里的id名和需要显示的地方的id名相同
    document.getElementById("countdown").innerHTML=(shengyuD+"天"+shengyuH+":"+shengyuM+":"+S+"<br>");
    // 每隔500毫秒执行一次
    setTimeout(clock,500);
}

   


//json数据
new Vue({
    el:"#app",
    data:{
        message:"正在请求数据..."
    },
    mounted(){
        axios
            .get('json/news.json')
            .then(response => this.message = response.data.urls)
            .catch(function(error){
                console.log(error);
            })
    }
})